/*
 * Copyright 2014 Rivaldo.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.jety.commons.util;

import java.util.Enumeration;
import java.util.Locale;
import java.util.ResourceBundle;

/**
 *
 * @author Rivaldo
 */
public class Teste {

    static public void main(String[] args) {

        Locale currentLocale;
        //ResourceBundle labels;  
        String language;
        String country;

        if (args.length != 2) {
            language = new String("en");
            country = new String("US");
        } else {
            language = new String(args[0]);
            country = new String(args[1]);
        }

        currentLocale = Locale.getDefault();
        System.out.println(Util.getErrorMessage("json.rpc.request.parse"));

        ResourceBundle labels
                = ResourceBundle.getBundle("ErrorMessages", currentLocale);
        Enumeration bundleKeys = labels.getKeys();

        while (bundleKeys.hasMoreElements()) {
            String key = (String) bundleKeys.nextElement();
            String value = labels.getString(key);
            System.out.println(key + " = " + value);
        }
    }
    
    /**
     * Shows the i18n message corresponding to the provided key in an error popup
     *
     * @param messageKey The i18n message key for the desired message
     * @param component  The parent component for the popup
     */
    public void showErrorKey(String messageKey) {
        ResourceBundle bundle = ResourceBundle.getBundle("ValidationMessages");
        //showErrorMessage(bundle.getString(messageKey), component);
    }
}
